package cool.webstudy.admin.constant.enums.rescode;

import lombok.extern.slf4j.Slf4j;

/**
 * @author think
 * @date 2025/11/23 23:16
 * @description: 检测服务返回码枚举
 */
@Slf4j
public enum CheckResCodeEnum implements BaseResCodeEnum{
    RC_ERROR_CHECK_DOWN("180001","检测站点是否宕机失败！"),
    ;
    private String code;
    private String msg;
    CheckResCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    @Override
    public String code() {
        return code;
    }

    @Override
    public String msg() {
        return msg;
    }
    public static CheckResCodeEnum getMsgByCode(String code){
        for (CheckResCodeEnum enumTime : CheckResCodeEnum.values()) {
            if (enumTime.code().equals(code)){
                return enumTime;
            }
        }
        log.error("getMsgByCode 无法获取枚举值");
        return null;
    }
}
